class AbstractCollection<T> implements Collection<T>
{
	private var _a:Array<T>;
	public var size(getSize,null):Int;
	
	private function new()
	{
		_a = new Array();
	}
	
	public function add( o:T ):Void
	{
		_a.push(o);
	}
	
	public function remove():T
	{
		return _a.pop();
	}
	
	public function clear():Void
	{
		_a = new Array();
	}
	
	public function toArray():Array<T>
	{
		return Lambda.array( _a );
	}
	
	public function isEmpty():Bool
	{
		return _a.length == 0;
	}
	
	private function getSize():Int
	{
		return _a.length;
	}
}